﻿mainModule.factory("userSvc", ["$http", "BaseApiSvc", function ($http, BaseApiSvc) {
    "use strict";
    var url = 'http://localhost:51924/api/admin/users/';
    var ChildSvc = function () {
        BaseApiSvc.call(this, url);
    };
    ChildSvc.prototype = Object.create(BaseApiSvc.prototype);

    ChildSvc.prototype.getRoles = function (id) {        
        return $http.get(this.url + id + "/roles/");
    };                
    ChildSvc.prototype.addToRole = function (id, role) {
        return $http.post(this.url + id + "/roles/", role);
    };
    ChildSvc.prototype.removeFromRole = function (id, role) {
        return $http.delete(this.url + id + "/roles/" + role);
    };    

    return new ChildSvc();
}]);